#!/usr/bin/env bash



pwd

# 设置tag
# image_version=`date +%Y%m%d%H%M`;
# echo $image_version;

# 停止之前的docker container
docker stop vue-server;

# 删除这个container
docker rm vue-server;



# build镜像
docker build  -t vue-server .;
docker images;

# 把刚刚build出来的镜像跑起来
docker run  --restart always --name vue-server -p 8999:8999 -v/root/.jenkins/workspace/vue-web:/home/project vue-server:latest;
docker logs vue-server;

# 删除这个镜像
docker rmi vue-server:latest;

